/*
 * @Description: 
 * @Author: duan_shuangjun 丶
 * @Date: 2025-09-17 10:44:22
 * @LastEditTime: 2025-09-17 10:50:45
 */
// 交班相关的操作 (暂无数据库操作) 接口离线模式定义

import { ok, fail } from '../utils/response'


export class WorkLogService {
    static workStatus() {
        const now = new Date()
        const currentHour = now.getHours()
        const currentMinute = now.getMinutes()
        const currentTime = currentHour * 100 + currentMinute // 转换为 HHMM 格式便于比较

        let currentSlot = "早市"

        // 根据时间判断当前时段
        if (currentTime >= 600 && currentTime <= 1100) {
            currentSlot = "早市" // 06:00-11:00
        } else if (currentTime >= 1101 && currentTime <= 1500) {
            currentSlot = "午市" // 11:01-15:00
        } else if (currentTime >= 1501 && currentTime <= 2100) {
            currentSlot = "晚市" // 15:01-21:00
        } else if (currentTime >= 2101 || currentTime <= 0) {
            currentSlot = "夜市" // 21:01-00:00 (跨天)
        }

        return ok({
            status: 0,
            current_slot: currentSlot,
            shop_status: 1
        })
    }
}